<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:replace="top::html" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>专家匹配需求</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<body class="fixed hold-transition skin-blue">
    <div class="wrapper">

        <div th:replace="tophtml::html"></div>
        <div th:replace="left::html"></div>

        <!-- 右边部分 -->
        <div class="content-wrapper">
            <section class="content-header">
                <h1>客户匹配需求<small></small></h1>
                <ol class="breadcrumb">
					<li><a href="/index"><i class="fa fa-dashboard"></i>用户中心</a></li>
					<li><a href="/customer/customerList">客户管理</a></li>
					<li><a href="#">客户匹配需求</a></li>
				</ol>
            </section>

            <!-- 右边列表展示 -->
            <section class="content container-fluid">
            	<!-- 提示检索条件 -->
				<form class="form-inline" th:action="@{/customer/searchMatchedDemand}" method="get" id="from1">
					<input type="hidden" name="pageNo" id="pageNo" /> 
					<input type="hidden" name="customerId" th:value="${customer.pid}" />
                    <input type="hidden" name="customerNumber" th:value="${customer.customerNumber}" />
                    <input type="hidden" name="customerName" th:value="${customer.customerName}" />
					<div class="form-group">
						<label style="margin-left: 3px;">ID / 名称</label>
                        <input style="margin-left: 3px;width: 202px; display: inline" type="text" class="form-control" name="searchKeyword" th:value="${searchKeyword}">
                    </div><br/>
                    <div class="form-group">
                        <label>需求类型</label>
                        <span th:each="dtd : ${demandTypeDictiontryList}" style="margin-left: 3px;">
                        	<label style="font-weight: lighter;">
                            	<input type="checkbox" name="demandType" th:value="${dtd.names}" th:text="${dtd.worth}" th:checked="${demandTypedArr != null ? #arrays.contains(demandTypedArr, dtd.names) : false}">
                            </label>
                        </span>
                        <span style="margin-left: 10px; color: red;">(可以多选)</span>
                    </div><br/>
                    <div class="form-group">
                        <label>所属领域</label>
                        <span th:each="rfd : ${researchFieldDictiontryList}" style="margin-left: 3px;">
                        	<label style="font-weight: lighter;">
                           		<input type="checkbox" name="researchField" th:value="${rfd.names}" th:text="${rfd.worth}" th:checked="${researchFieldArr != null ? #arrays.contains(researchFieldArr, rfd.names) : false}">
                            </label>
                        </span>
                        <span style="margin-left: 10px; color: red;">(可以多选)</span>
	                    <button type="submit" class="btn btn-primary" style="margin-left: 40px;">搜索</button>
						<button type="reset" style="margin-left: 40px;" class="btn btn-primary">重置</button>
						<input type="button" class="btn btn-primary" value="返回" onclick="window.history.go(-1)" style="margin-left: 40px;">
					</div>
                    <div>
                        <span class="from-group">
	                        <label>所属地区</label>
	                        <label style="font-weight: lighter;">
	                        	<input style="margin-left: 3px;" type="radio" name="domesticOrForeign" id="optionsRadios1" value="0" th:checked="${demand != null ? demand.domesticOrForeign == 0 : false}"> 国内
	                        </label>
	                        <label style="font-weight: lighter;">
	                        	<input style="margin-left: 15px;" type="radio" name="domesticOrForeign" id="optionsRadios2" value="1" th:checked="${demand != null ? demand.domesticOrForeign == 1 : false}"> 国外
	                        </label>
                        </span>
                        <span class="form-group form-country">
	                        <label style="margin-left: 40px;">国家</label>
	                        <select class="form-area" style="margin-left: 5px;width: 202px;height: 33px;border-color: silver;">
	                            <option value="-1">--选择国家--</option>
	                            <option th:each="list:${countryDictiontryList}" th:value="${list.pid}" th:text="${list.worth}" th:selected="${list.pid eq country}"></option>
	                        </select>
                        </span><br/>
                        <span class="form-group form-area">
                        	<label style="margin-left: 42px;">省</label>
	                        <select class="form-area" id="provinceId" style="margin-left: 2px;width: 202px;height: 33px;border-color: silver;">
	                            <option value="-1">--选择省--</option>
	                            <option th:each="list:${provinceDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq province}"></option>
	                        </select>
                        </span>
                        <span class="form-group form-area">
                        	<label style="margin-left: 5px;">市</label>
	                        <select class="form-area" id="cityId" style="margin-left: 5px;width: 202px;height: 33px;border-color: silver;">
	                            <option value="-1">--选择市--</option>
	                            <option th:each="list:${cityDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq city}"></option>
	                        </select>
                        </span>
                        <span class="form-group form-area">
                        	<label style="margin-left: 5px;">区</label>
	                        <select class="form-area" id="areaId" style="margin-left: 5px;width: 202px;height: 33px;border-color: silver;">
	                            <option value="-1">--选择区--</option>
	                            <option th:each="list:${areaDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq area}"></option>
	                        </select>
                        </span>
                        
                    </div>
				</form>
				<div class="box">
					<div class="box-header with-border">
						<h3 class="box-title">
							<button class="btn btn-primary" id="dosubmit">匹配</button>
							<label style="margin-left: 20px;font-weight: lighter;">客户姓名:</label> 
							 <a th:text="${customer.customerName}"  th:href="@{'/customer/customerList?pid='+${customer.pid}}" class="form-control" style="width: 202px;margin-left: 163px;margin-top: -36px;"/>
						</h3>
					</div>
					<!-- /.box-header -->
					<div class="box-body">
						<table class="table table-bordered">
							<tbody>
								<tr>
									<th><input id="all" type="checkbox" th:disabled="${not #lists.isEmpty(buttedDemandIdList)}" /></th>
									<th>需求id</th>
									<th>需求名称</th>
                                    <th>需求类型</th>
                                    <th>需求状态</th>
                                    <th>需求联系人</th>
								</tr>
								<tr th:each="demand : ${pageInfo.list}" th:class="${#lists.contains(buttedDemandIdList, demand.pid) ? 'butt-gray' : ''}">
									<td>
										<input type="checkbox" class="matched" th:disabled="${#lists.contains(buttedDemandIdList, demand.pid)}" 
											   th:value="'demandId='+${demand.pid}+'&demandNumber='+${demand.demandNumber}+'&demandName='
											   +${demand.demandName}+'&customerId='+${customer.pid}+'&customerNumber='+${customer.customerNumber}+
											   '&customerName='+${customer.customerName}" />
									</td>
									
									 <td title="查看需求详情">
                                        <a th:href="@{'/demand/showDetail?demandId='+${demand.pid}}" th:text="'D' + ${demand.demandNumber}">详情</a>
                                    </td>
                                    
                                     <td title="查看需求详情">
                                        <a th:href="@{'/demand/showDetail?demandId='+${demand.pid}}" th:text="${demand.demandName}">详情</a>
                                    </td>
									
                                    <td th:text="${demand.demandType}"></td>
                                    <td th:text="${demand.demandStatusWorth}"></td>
									<td>
										<a th:href="@{'/demand/showUpdateContact?demandContactId='+${demand.per == null ? '' : demand.per.pid}}" 
										   th:text="${demand.per == null ? '' : demand.per.name}">联系人</a>
									</td>
								</tr>
							</tbody>
						</table>
						<div th:replace="page::html"></div>
						<p style="color: red;" th:text="${demandContactIdExists}"></p>
					</div>
				</div>
			</section>
        </div>

        <div th:replace="footer::html"></div>
        <div class="control-sidebar-bg"></div>
    </div>

    <!-- 引入js -->
	<div th:replace="bottom::html" ></div>

</body>
	<!-- 正则表达式 -->
	<script type="text/javascript" th:inline="javascript">
		matchButt([[@{/customer/pipei}]]);
	</script>

</html>